package cn.sciento.core.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.HashMap;
import java.util.Map;

@ConfigurationProperties(prefix = "stong", ignoreInvalidFields = true)
public class ServiceProperties {
    public static final String PREFIX = "stong";

    private Map<String, Service> service = new HashMap<>();

    public Map<String, Service> getService() {
        return this.service;
    }

    public void setService(Map<String, Service> service) {
        this.service = service;
    }

    public static class Service {
        private String name;

        private String code;

        private String path;

        private int port;

        private int redisDb;

        public String getName() {
            return this.name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getCode() {
            return this.code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getPath() {
            return this.path;
        }

        public void setPath(String path) {
            this.path = path;
        }

        public int getPort() {
            return this.port;
        }

        public void setPort(int port) {
            this.port = port;
        }

        public int getRedisDb() {
            return this.redisDb;
        }

        public void setRedisDb(int redisDb) {
            this.redisDb = redisDb;
        }
    }
}
